[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
BEGIN BREAK supress of system error call:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Syntax:
~~~~~~~

  BEGIN BREAK
    //any source code which can cause an error
  [RECOVER BREAK [USING oError]]   //unconditional error recover
    //any source code to handle the error
  END BREAK

Description:
~~~~~~~~~~~~~
This program construction is suitable for runtime error handle. All errors
causing the "Error CLIPPER/BASE..." are handled by your code. If there is
no command RECOVER BREAK... the control goes immediately to the first command
after the END BREAK, and the error occurance is supressed.
If the RECOVER BREAK... is used :

1.There was no error between BEGIN BREAK and RECOVER BREAK then the
  RECOVER BREAK... command gives the control to the first command
  after the END BREAK. So in this case the code part between
  RECOVER BREAK... and END BREAK is skipped.

2.If there was a error between BEGIN BREAK a RECOVER BREAK then remaining
  code of this part is skipped and the control goes to the first command
  after the RECOVER BREAK...

If you use the full RECOVER BREAK USING oError command, then before the
control goes to the error handling part the variable oError is filled with
clipper object of Error class. This object describes the error type.

Example:
~~~~~~~~
  ...
  REPEAT
    BEGIN BREAK
      Expr:=Space(20)
      Expr:=EditIt(Expr,"Input the valid clipper expression:")
      x:=&(Expr)
    RECOVER BREAK USING oError
      Alert("This was not a valid expression!;"+ErrorMessage(oError))
      LOOP
    END BREAK
  UNTIL true

This code part will be repeated until you input the valid clipper expression.

Comment:
~~~~~~~~
If there occures a rutime error in a part between RECOVER BREAK and END
BREAK, it will be handled in the standard way, with error message and
exiting the program. See the BEGIN SEQUENCE.

Source file is Object.ch

See Also: REPEAT EditIt ErrorMessage
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson